<?php
/**
 * Created by PhpStorm.
 * User: 44766
 * Date: 2018-11-15
 * Time: 17:22
 */

namespace App\Services\CrawlerService;


use App\Services\CrawlerService\driver\Xinxin21ccnnDriver;

class CrawlerService
{
    protected $driver;

    public function __construct($driver)
    {
        $this->driver = new $driver();;
    }

    public function getList()
    {
        return $this->driver->getListPage()->getList();
    }

    public function getDetail($url)
    {
        return $this->driver->getDetail($url);
    }

    public function __call($name, $arguments)
    {
        $this->driver = $this->driver->$name(...$arguments);
        return $this;
    }
}